package com.ixion.blog.bean;

import java.util.Date;
import java.util.List;

import org.nutz.dao.entity.annotation.ColDefine;
import org.nutz.dao.entity.annotation.ColType;
import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Id;
import org.nutz.dao.entity.annotation.Many;
import org.nutz.dao.entity.annotation.Name;
import org.nutz.dao.entity.annotation.One;
import org.nutz.dao.entity.annotation.Table;

/**
 * @author 贵源 <br>
 *         create at 2014年5月11日
 */
@Table("blog_article")
public class Article {
	@Id
	@Column("article_id")
	private int id;
	@Name
	@Column("article_title")
	private String title;
	@Column("article_summary")
	private String summary;
	@Column("article_content")
	@ColDefine(width = 4000, type = ColType.TEXT)
	private String content;
	@Column("article_publish_date")
	private Date publishDate;
	/**
	 * 作者
	 */
	@One(target = User.class, field = "author_id")
	private User author;
	/**
	 * 分类
	 */
	@One(target = Catalog.class, field = "catalog_id")
	private Catalog catalog;
	/**
	 * 评论
	 */
	@Many(target = Comment.class, field = "article_id")
	private List<Comment> comments;

	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * @return the title
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * @param title
	 *            the title to set
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * @return the summary
	 */
	public String getSummary() {
		return summary;
	}

	/**
	 * @param summary
	 *            the summary to set
	 */
	public void setSummary(String summary) {
		this.summary = summary;
	}

	/**
	 * @return the content
	 */
	public String getContent() {
		return content;
	}

	/**
	 * @param content
	 *            the content to set
	 */
	public void setContent(String content) {
		this.content = content;
	}

	/**
	 * @return the publishDate
	 */
	public Date getPublishDate() {
		return publishDate;
	}

	/**
	 * @param publishDate
	 *            the publishDate to set
	 */
	public void setPublishDate(Date publishDate) {
		this.publishDate = publishDate;
	}

}
